ecshop̨дshell© 0day

ժҪ
adminedit_languages.php رû! elseif ($_REQUEST['act'] == 'edit'){ /* · */ $lang_file = isset($_POST['file_path']) ? trim($_POST['file_path']) : ''; /* 滻ǰ */ $src_items = !empty($_POST['item']) ? stripslashe


adminedit_languages.php رû! elseif ($_REQUEST['act'] == 'edit') { /* · */ $lang_file = isset($_POST['file_path']) ? trim($_POST['file_path']) : ''; /* 滻ǰ */ $src_items = !empty($_POST['item']) ? stripslashes_deep($_POST['item']) : ''; /* ޸Ĺ */ $dst_items = array(); $_POST['item_id'] = stripslashes_deep($_POST['item_id']); for ($i = 0; $i < count($_POST['item_id']); $i++) { /* Ϊգ޸ */ if (trim($_POST['item_content'][$i]) == '') { unset($src_items[$i]); } else { $_POST['item_content'][$i] = str_replace('\\n', '\n', $_POST['item_content'][$i]); $dst_items[$i] = $_POST['item_id'][$i] .' = '. '"' .$_POST['item_content'][$i]. '";'; } } /* ú༭ */ $result = set_language_items($lang_file, $src_items, $dst_items); if ($result === false) { /* ޸ʧʾϢ */ $link[] = array('text' => $_LANG['back_list'], 'href' => 'javascript:history.back(-1)'); sys_msg($_LANG['edit_languages_false'], 0, $link); } ........................................ function set_language_items($file_path, $src_items, $dst_items) { /* ļǷд޸ģ */ if (file_mode_info($file_path) < 2) { return false; } /* ȡļ */ $line_array = file($file_path); if (!$line_array) { return false; } else { $file_content = implode('', $line_array); } $snum = count($src_items); $dnum = count($dst_items); if ($snum != $dnum) { return false; } /* 򣬷ֹλ滻 */ ksort($src_items); ksort($dst_items); for ($i = 0; $i < $snum; $i++) { $file_content = str_replace($src_items[$i], $dst_items[$i], $file_content); } /* д޸ĺ */ $f = fopen($file_path, 'wb'); if (!$f) { return false; } if (!fwrite($f, $file_content)) { return false; } else { return true; } } echop exp վṩ()ܴй,ȫоѧ֮,Ը!
 ļ:
phpļ ؼ: 
ѡļ ע:
Ҫ滻 